﻿<%@ Page Title="TODO SALUD - Consultar turnos" Language="C#" MasterPageFile="~/Sistema.Master"
    AutoEventWireup="true" CodeBehind="ConsultarTurnos.aspx.cs" Inherits="CMS.ConsultarTurnos" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cpHead" runat="server">
    <link type="text/css" rel="stylesheet" href="http://jquery-ui.googlecode.com/svn/tags/1.7/themes/redmond/jquery-ui.css" />
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
    <script src="jquery-validation-1.13.1/lib/jquery-1.11.1.js" type="text/javascript"></script>
    <script src="jquery-1.11.1.min.js" type="text/javascript"></script>
    <script src="js/jquery-ui-1.10.4.custom.js" type="text/javascript"></script>
    <script src="js/jquery-ui-1.10.4.custom.min.js" type="text/javascript"></script>
    <script src="jquery-validation-1.13.1/dist/jquery.validate.js" type="text/javascript"></script>
    <script src="jquery-validation-1.13.1/dist/jquery.validate.min.js" type="text/javascript"></script>
    <script type="text/javascript">
           $(document).ready(function () {
            $("#<%= txtFecha.ClientID%>").datepicker(
            {

                dateFormat: 'dd/mm/yy',
                minDate: '+0D',
                maxDate: '+1Y',
                changeMonth: true,
                changeYear: true,
                numberOfMonths: 1,
                dayNamesMin: ['Do', 'Lu', 'Ma', 'Mi', 'Ju', 'Vi', 'Sa'],
                monthNames: ['Enero', 'Febrero', 'Marzo', 'Abril', 'Mayo',
                    'Junio', 'Julio', 'Agosto', 'Septiembre',
                    'Octubre', 'Noviembre', 'Diciembre'],
                monthNamesShort: ['Ene', 'Feb', 'Mar', 'Abr',
                    'May', 'Jun', 'Jul', 'Ago',
                    'Sep', 'Oct', 'Nov', 'Dic']

            });
        });
    </script>

     <style type="text/css"> 
    .modalBackground        
        {
    	    background-color:black;
    	    filter: alpha(opacity=70);
            opacity: 0.7;
    	   
    	}
    .modalPopup
    {
         border: 4px outset Black;
             background-color: silver;
             padding: 0px;
             font-weight: bold;
             
    }
    .ui-datepicker
        {
            font-size: 14px !important;
        }
    </style>

 
    <style type="text/css">
        .style1
        {
            width: 99%;
        }
        .style6
        {
            height: 26px;
            width: 383px;
        }
        .style20
        {
            width: 224px;
            height: 26px;
        }
        .style24
        {
            height: 26px;
            width: 737px;
        }
        .style27
        {
            height: 26px;
            width: 391px;
        }
        .style28
        {
            width: 96%;
        }
        .style29
        {
            width: 161px;
        }
        .style30
        {
            width: 202px;
        }
        .style31
        {
            width: 206px;
        }
        .style32
        {
            width: 157px;
        }
        .graypanelDiv
        {
            width: 253px;
        }
        .style33
        {
            width: 11px;
        }
        .style34
        {
            width: 107px;
        }
        .style35
        {
            width: 112px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpTituloPagina" runat="server">
    <h1>
        <a href="index.aspx" id="logo">TODO SALUD - <em>Sistema WEB</em></a></h1>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cpNav" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cpContenido" runat="server">
    
    <asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
    </asp:ToolkitScriptManager>

    <header><h2 style="height: 29px">Consultar Turnos disponibles</h2>
    
    <!-- Ventana de dialogo -->
    <div id="dialogoFormulario" title="Atencion" style= "display:none;"> 
    
    <p><span class="ui-icon ui-icon-alert" style="float:left;margin:07px 20px 0;"></span> 
    ¿Desea registrar Turno?
    </p>
     </div>



    <div style="height: 643px; width: 710px">
        <table>
            </table>
        &nbsp;Solicitar 
        Turno:<br />
        <br />
        1-Seleccione Especialidad, Medico y fecha del turno.<br />
        2-Presione boton Buscar.<br />
        3-Seleccione el turno a la hora que desea y presione registrar.<br />
        4-Confirme el turno.<br />
&nbsp;&nbsp;&nbsp;&nbsp;
        <br />
        <table class="style1">
            <tr>
                <td class="style24">
                    Especialidad:</td>
                <td class="style20">
                    <asp:DropDownList ID="cmbEspecialidad" runat="server" 
                        onselectedindexchanged="cmbEspecialidad_SelectedIndexChanged1" 
                        AutoPostBack="True">
                    </asp:DropDownList>
                </td>
                <td class="style27">
                    &nbsp;&nbsp;
                    </td>
                <td class="style6">
                    Medico:&nbsp;&nbsp;</td>
                <td class="style6">
                    <asp:DropDownList ID="cmbMedico" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="cmbMedico_SelectedIndexChanged" 
                        ontextchanged="cmbMedico_TextChanged" style="margin-left: 0px" 
                        Width="200px">
                    </asp:DropDownList>
                    </td>
            </tr>
            </table>
        <br />
        <table class="style28">
            <tr>
                <td class="style29">
        Fecha de busqueda</td>
                <td class="style30">
                    <asp:TextBox ID="txtFecha" runat="server" height= "35px"    width= "125px"> </asp:TextBox>
                </td>
                <td>
                    <asp:Button ID="btnBuscar" runat="server" Text="Buscar" height= "35px"    width= "125px" onclick="btnBuscarTurnos" />
                </td>
            </tr>
        </table>
        <table class="style28">
            <tr>
                <td>
                    <asp:Label ID="lblError" runat="server" Text="Label"></asp:Label>
                </td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
        <asp:GridView ID="grd" runat="server" DataKeyNames="idTurno" AutoGenerateColumns="False" Height="16px" 
          
            style="margin-left: 74px" Width="474px" 
            onselectedindexchanged="grd_SelectedIndexChanged" 
            onrowcommand="grd_RowCommand" onrowdatabound="grd_RowDataBound" 
            BackColor="White" BorderColor="#CC9966" BorderStyle="None" BorderWidth="1px" 
            CellPadding="4">
            <Columns>
                <asp:BoundField DataField="fechaTurno" DataFormatString="{0:M-dd-yyyy}" 
                    HeaderText="Fecha" SortExpression="Fecha" />
                <asp:BoundField DataField="dia" HeaderText="Dia" />
                <asp:BoundField DataField="horaTurno" DataFormatString="{0:hh\:mm}" 
                    HeaderText="Hora" SortExpression="Hora" />
                <asp:CommandField ShowSelectButton="True" />
                <asp:BoundField HeaderText="Estado" SortExpression="Estado" />
                <asp:BoundField DataField="idTurno" HeaderText="idTurno" Visible="false"
                    SortExpression="idTurno" />
            </Columns>
            <FooterStyle BackColor="#FFFFCC" ForeColor="#330099" />
            <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="#FFFFCC" />
            <PagerStyle BackColor="#FFFFCC" ForeColor="#330099" HorizontalAlign="Center" />
            <RowStyle BackColor="White" ForeColor="#330099" />
            <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="#663399" />
            <SortedAscendingCellStyle BackColor="#FEFCEB" />
            <SortedAscendingHeaderStyle BackColor="#AF0101" />
            <SortedDescendingCellStyle BackColor="#F6F0C0" />
            <SortedDescendingHeaderStyle BackColor="#7E0000" />
        </asp:GridView>
        <br />
        <table class="style28">
            <tr>
                <td class="style31">
                    <asp:Panel ID="pnlRegistro" runat="server">
                        <asp:Label ID="lblExito" runat="server" Text="Label" BorderStyle="Groove" 
                            Font-Bold="True" Font-Italic="False" Font-Size="Large"></asp:Label>
                    </asp:Panel>
                </td>
                <td class="style32">
                    &nbsp;</td>
                <td>
        <asp:Button ID="btnRegistrar" runat="server" onclick="btnRegistrarTurno"  Text="Registrar" height= "35px" Width="125px" OnClientClick = "Confirm()"/>
                </td>
                
            </tr>
        </table>
        <br />
         <asp:Panel ID="Panel1" runat="server" Style="display:none;"   CssClass="modalPopup" Height="114px" 
            Width="326px" Font-Italic="False">
            
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
             <asp:Label ID="Label1" runat="server" Text="¿Desea registrar turno?"></asp:Label>
             <br />
             &nbsp;<br />
             <table class="style28">
                 <tr>
                     <td class="style35">
                         <asp:Button ID="btnAceptar" runat="server" Text="Aceptar" 
                             onclick="btnAceptar_Click1" Height="35px" Width="60px" />
                     </td>
                     <td class="style33">
                         &nbsp;</td>
                     <td class="style34">
                         <asp:Button ID="btnCancelar" runat="server" Text="Cancelar" 
                             onclick="btnCancelar_Click1" Height="35px" />
                     </td>
                 </tr>
             </table>
        </asp:Panel>
         <asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server" 
            BackgroundCssClass="modalBackground" PopupControlID="Panel1" 
            TargetControlID="btnRegistrar" onokscript="okScript">
        </asp:ModalPopupExtender>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <br />
        <br />
        <br />
    </div>
    </header>
</asp:Content>
